<%-- 
    Document   : upload
    Created on : May 26, 2012, 9:12:54 PM
    Author     : Eldred
--%>


<%@page import="org.apache.commons.fileupload.FileItem"%>
<%@page import="cz.muni.fi.pb138.srgsxmldb.servlets.ProcessFailures"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<div class="list">        
        <%  
            String fileName = ((FileItem) request.getAttribute("file")).getName();
                    
            switch((ProcessFailures) request.getAttribute("failure")){
                
                case ISFIELD: {
                    out.println("SOMETHING TERRIBLE HAPPENED");
                    break;
                }
                case NOTWELLFORMED: {
                    out.println("UPLOADED FILE "+ fileName +" IS NOT A WELL-FORMED XML");
                    break;
                }
                case NOTSRGS: {
                    out.println("UPLOADED FILE "+ fileName +" IS NOT A SRGS XML");
                    break;
                }
                case NONE: {
                    out.println("Grammar succesfully uploaded: " + fileName);
                    break;
                }
            }
        %>     
</div>
